﻿using System;
using System.Collections.Generic;

using Fuse8.ContentManagementFramework.Domain;
using Fuse8.ContentManagementFramework.Domain.Commands;
using Fuse8.DomainFramework.Common.Locator;
using Fuse8.ContentManagementFramework.Domain.Commands.CommandParameters;

namespace Fuse8.ContentManagementFramework.BizFacade.Services
{
    public class CmsModuleService : CmsSiteBusinessService<CmsModule>
    {
        public override IEnumerable<CmsModule> FindAll()
        {
            var command = DependencyServiceLocator.Current.GetInstance<CmsModuleSelectAllCommand>();

            var commandParameter = new CmsModuleSelectAllCommandParameter();

            SiteAwareEntityObjectMediator.SetSiteEntity(commandParameter);

            command.ConfigureCommand(commandParameter);

            return Find(command);
        }
    }
}
